import request from '@/utils/request'

/**
 * 获取权限列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getPermissionsList() {
  return request({
    url: '/v1/permission/list',
    method: 'get'
  })
}

/**
 * 获取权限层级列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getParentPermissions() {
  return request({
    url: '/v1/permission/parent-list',
    method: 'get'
  })
}

// 编辑权限（包含新增和修改）
export function editPermission(data) {
  return request({
    url: '/v1/permission/edit',
    method: 'post',
    data
  })
}

// 删除权限
export function deletePermission(data) {
  return request({
    url: '/v1/permission/delete',
    method: 'post',
    data
  })
}

